<!DOCTYPE html>
<html lang="zh">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" />
    <title>修改密码</title>
    <link rel="icon" href="Ly-admin-Iframe/favicon.ico" type="image/ico">
    <link href="Ly-admin-Iframe/css/bootstrap.min.css" rel="stylesheet">
    <link href="Ly-admin-Iframe/css/materialdesignicons.min.css" rel="stylesheet">
    <link href="Ly-admin-Iframe/css/style.min.css" rel="stylesheet">
    <script>
        if (document.referrer === ''){
            location='/admin';
        }
    </script>
</head>

<body>
<div class="container-fluid p-t-15">

    <div class="row">
        <div class="col-lg-12">
            <div class="card">
                <div class="card-body">

                    <form id="modpwd_form" method="post" action="/changePassword" class="site-form">
                        <div class="form-group">
                            <label for="old-password">旧密码</label>
                            <input type="password" class="form-control" name="oldpwd" id="old-password" placeholder="输入账号的原登录密码">
                        </div>
                        <div class="form-group">
                            <label for="new-password">新密码</label>
                            <input type="password" class="form-control" name="newpwd" id="new-password" placeholder="输入新的密码">
                        </div>
                        <div class="form-group">
                            <label for="confirm-password">确认新密码</label>
                            <input type="password" class="form-control" name="confirmpwd" id="confirm-password">
                        </div>
                        <button type="submit" class="btn btn-primary">修改密码</button>
                    </form>

                </div>
            </div>
        </div>

    </div>

</div>
<script type="text/javascript" src="Ly-admin-Iframe/js/jquery.min.js"></script>
<script type="text/javascript" src="Ly-admin-Iframe/js/jquery.form.min.js"></script>
<script type="text/javascript" src="Ly-admin-Iframe/js/bootstrap.min.js"></script>
<script type="text/javascript" src="Ly-admin-Iframe/js/main.min.js"></script>
<!--弹出框插件-->
<script type="text/javascript" src="Ly-admin-Iframe/js/bootbox.min.js"></script>
<script type="text/javascript" src="Ly-admin-Iframe/js/bootbox.locales.min.js"></script>
<script>
    $(function () {
        $("#modpwd_form").ajaxForm(function (message) {
            if (message.code === 200){
                bootbox.alert({message: "密码修改成功",size:'small'});
            }else if (message.code === 0){
                bootbox.alert({message: "原密码错误",size:'small'});
            }else if (message.code === 1){
                bootbox.alert({message: "新密码不能与原密码一样",size:'small'});
            }else if (message.code === 2){
                bootbox.alert({message: "两次密码输入不一致",size:'small'});
            }else if (message.code === 3){
                bootbox.alert({message: "密码必须长度大于等于8位，必须包含数字、字母大小写、特殊符号其中至少三项",size:'small'});
            }else if (message.code === 400){
                bootbox.alert({message: "修改密码失败",size:'small'});
            }
        });
    });

</script>
</body>
</html>